<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>帐号设置 - 安装第<?php echo $step;?>步 </title>

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

<link href="install/template/images/installcss.css" rel="stylesheet" type="text/css" />

<script language="JavaScript" src="install/template/images/jquery.min.js"></script>

</head>

<body>

<div class="Conten">

<div class="box ">

<div class="instop"><span><a href="<?php echo TCCMS_SITE;?>" target="_blank">官方网站</a>　|　<a href="<?php echo BBS_SITE;?>" target="_blank">官方论坛</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><strong>开始安装<?php echo TCCMS_NAME;?> <?php echo TCCMS_VERSION;?></strong></div>

</div>

  <div class="box">

  <div class="insdirbg">

  <div class="insjd06"></div>

  <div class="insdir_l">

  <div class="t1 by"></div> <div class="t2 by"></div>

  <div class="insdir_lbh">

  <ul>

    <li>1、安装须知</li>
    <li>2、软件许可协议</li>
    <li>3、运行环境检测</li>
    <li>4、文件权限检测</li>
    <li  class="dir">5、帐号设置</li>
    <li>6、网络数据初始化</li>
    <li>7、安装完成</li>
    </ul></div>

    <div class="t2 by"></div> <div class="t1 by"></div>

  </div>

  <div class="insdir_r">

  <div class="t1 bs"></div> <div class="t2 bs"></div>

  <div class="insdir_rbh">

  <div id="introducetd">

  <form id="install" action="install.php?" method="post">

   <table width="646px" border="0" cellspacing="1" cellpadding="0" class="table">

  <tr>

    <td colspan="2" align="center"><strong><font style="font-size:14px">填写数据库信息</font></strong></td>

  </tr>

  <tr>

    <td width="18%" align="right">数据库主机：</td>

    <td width="60%">

  <input name="config[db_host]" id="db_host" type="text" value="localhost" style="widtd:120px" class="insput"/></td>

  </tr>

  <tr>

    <td width="18%" align="right">数据库帐号：</td>

    <td width="60%"><input name="config[db_user]" id="db_user" type="text" value="root" style="widtd:120px" class="insput"/></td>

  </tr>

  <tr>

    <td width="18%" align="right">数据库密码：</td>

    <td width="60%"><input name="config[db_psw]" id="db_psw" type="password" value="" style="widtd:120px" class="insput"/></td>

  </tr>

  <tr>

    <td width="18%" align="right">数据库名称：</td>

    <td width="60%"><input name="config[db_name]" id="db_name" type="text" value="testcms" style="widtd:120px" class="insput"/></td>

  </tr>

  <tr title="如果一个数据库安装多个CMS，请修改表前缀">

    <td width="18%" align="right">数据表前缀：</td>

    <td width="60%"><input name="config[db_pre]" id="db_pre" type="text" value="ec_" style="widtd:120px" class="insput"/> <font color="#FF3300">不建议修改!</font></td>

  </tr>

  <tr title="如果您的服务器是独立服务器则建议选择是，如果是虚拟机则建议选择否!">

    <td width="18%" align="right">启用持久连接：</td>

    <td width="60%"><input name="config[db_pconnect]" type="radio" value="1" 

是&nbsp;&nbsp;

	<input name="config[db_pconnect]" type="radio" value="0" 

否 &nbsp;&nbsp;建议选否!</td>

  </tr>

<tr>

    <td width="18%" align="right">数据库编码：</td>

    <td width="60%"><input name="config[db_code]" type="radio" value="GBK" checked />GBK&nbsp;

	<input name="config[db_code]" type="radio" value="UTF8" disabled/>UTF8 &nbsp;&nbsp;</td>

  </tr>
  
  <tr>

    <td colspan="2" align="center"><strong><font style="font-size:14px">填写管理员信息</font></strong></td>

  </tr>

  <tr>

    <td width="18%" align="right">管理帐号：</td>

    <td width="60%"><input name="username" id="username" type="text" value="admin" style="widtd:120px" class="insput"/> 由2到30个数字，字母，下划线组成！</td>

  </tr>

  <tr>

    <td width="18%" align="right">管理密码：</td>

    <td width="60%"><input name="password" id="password" type="password" value="admin888" style="widtd:120px" class="insput"/> 由6到30个数字，字母，下划线组成！<font color="#FF3300">默认为 admin888</font></td>

  </tr>

  <tr>

    <td width="18%" align="right">确认密码：</td>

    <td width="60%"><input name="pwdconfirm" id="pwdconfirm" type="password" value="admin888" style="widtd:120px" class="insput"/></td>

  </tr>

  <tr>

    <td width="18%" align="right">E-mail：</td>

    <td width="60%"><input name="email" id="email" type="text" value="admin@teamcen.com" style="widtd:120px" class="insput"/>

	<input type="hidden" name="step" value="6"/></td>

  </tr>

  <tr>

    <td width="18%" align="right">是否安装测试数据：</td>

    <td width="60%"><input name="withdata" type="radio" checked="checked" value="1"/> 安装 <input name="withdata" type="radio" value="0"/> 不安装 </td>

  </tr>

</table>

  </div>

</div>

    <div class="t2 bs"></div> <div class="t1 bs"></div>
  </div>
  </div>

      <div class="ins_rin" align="center">

	<input type="hidden" name="step" value="6">

    <span><input onClick="javascript:history.back(-1);" type="button" name="step" value="返回上一步"style='background:url(install/template/images/bgbtn.gif);width:108px;height:27px;max-height:27px; line-height:27px;border:0px;cursor:pointer;font-size:13px;margin-top:1px; text-align:center; color:#FFF;'/></span> 
    <span><input onClick="$('#install').submit();;" type="button" name="step" value="确认信息继续"style='background:url(install/template/images/bgbtn.gif);width:108px;height:27px;max-height:27px; line-height:27px;border:0px;cursor:pointer;font-size:13px;margin-top:1px; text-align:center; color:#FFF;'/></span>

    </form>

      </div>
  </div>
</div>
</body>
</html>

<script language="JavaScript" type="text/javascript">
      function checkform() 
      {
        if($('#username').val().length<2 || $('#username').val().length>30)
        {
          alert('超级管理员帐号不能少于2个字符或者大于20个字符');
          return false;
        }
        if($('#password').val().length<6 || $('#username').val().length>30)
        {
          alert('超级管理员密码不能少于6个字符或者大于20个字符');
          return false;
        }
        if($('#password').val()!=$('#pwdconfirm').val())
        {
          alert('两次输入密码不一致！');
          return false;
        }
        if($('#email').val()=='')
        {
          alert('请输入E-mail！');
          $('#email').focus();
          return false;
        }
        else
        {
          var emailPattern = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
          if (emailPattern.test($('#email').val())==false)
          {
            alert('请填写正确的E-mail！');
            return false;
          }
        }
        var url = '?step=checksubmit&dbhost='+$('#db_host').val()+'&dbuser='+$('#db_user').val()+'&dbpw='+$('#db_psw').val()+'&dbname='+$('#db_name').val()+'&tablepre='+$('#db_pre').val()+'&sid='+Math.random()*5;
          $.get(url, function(data){
          if(data > 1){
            alert(errmsg[data]);
            return false;
          }else if(data == 1 || (data == 0 && confirm(errmsg[0]))){
              $('#install').submit();
          }
        });

          return false;

      }



</script>

